package com.foreknow.elmboot.controller;

import com.foreknow.elmboot.po.Business;
import com.foreknow.elmboot.service.BusinessService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

import java.util.List;

/**
 * @author 啊滨
 * @date 2023/3/2 10:36
 */
@RestController //标注当前类是一个Controller控制器   相当于@Controller+@ResponseBody
@RequestMapping("/BusinessController")//请求映射     总路由
public class BusinessController {
    @Autowired
    private BusinessService businessService;


    @RequestMapping("/listBusinessByOrderTypeId")   //子路由
    public List<Business> listBusinessByOrderTypeId(Business business){
        return businessService.listBusinessByOrderTypeId(business.getOrderTypeId());
    }

    @RequestMapping("/getBusinessById")
    public Business getBusinessById(Business business) {
        return businessService.getBusinessById(business.getBusinessId());
    }
}
